﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using NUnit.Framework;
using GraphCompiler.Core.SyntaxRepresentation;

namespace GraphCompiler.Specification.SyntaxRepresentation
{
    [TestFixture]
    public class ArrowNodeSpecs
    {
        [Test]
        public void GivenArrowWithBoxNames_IsEqualToSelf()
        {
            var node = new ArrowNode("from", "to");
            Assert.AreEqual(node, node);
        }

        [Test]
        public void GivenArrowWithBoxNames_IsEqualToOtherArrowWithSameProperties()
        {
            var node1 = new ArrowNode("from", "to");
            var node2 = new ArrowNode("from", "to");

            Assert.AreEqual(node1, node2);
        }

        [Test]
        public void GivenArrowWithBoxNames_IsNotEqualToOtherArrowWithDifferentFromName()
        {
            var node1 = new ArrowNode("from", "to");
            var node2 = new ArrowNode("from2", "to");

            Assert.AreNotEqual(node1, node2);
        }

        [Test]
        public void GivenArrowWithBoxNames_IsNotEqualToOtherArrowWithDifferentToName()
        {
            var node1 = new ArrowNode("from", "to");
            var node2 = new ArrowNode("from", "to2");

            Assert.AreNotEqual(node1, node2);
        }

        [Test]
        public void UsesArrowNotationAsStringRepresentation()
        {
            var node = new ArrowNode("from", "to");
            Assert.AreEqual("from -> to", node.ToString());
        }
    }
}